import { FC } from "react"

import { SFormItem } from "@/components/common"
import StyleSelect from "@/components/common/styleSelect"
import { useLocale } from "@/locales"

const OperationItem: FC<any> = ({ rules, selectorProps, options = [] }) => {
	const { newFormat } = useLocale()

	return (
		<SFormItem colon name={"operationItem"} label={newFormat("common.action_module")} rules={rules}>
			<StyleSelect
				allowClear
				placeholder={newFormat("common.select_all")}
				options={options.map((item: string) => ({ label: item, value: item }))}
				{...selectorProps}
			/>
		</SFormItem>
	)
}

export default OperationItem
